from transformers import  BertModel, BertConfig

config = BertConfig().from_pretrained(r"D:\AI\model\bert-base-chinese")
config.max_position_embeddings = 1500
print( config)

# 初始化模型
model = BertModel(config)
print(model)

# 获取模型配置
config = model.config
print(config)